﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Caching;

namespace LeMigue.Framework.Utils
{
    public static class Cache
    {
        public static void Set<T>(string superKey, string key, T valor)
        {
            HttpRuntime.Cache.Add(String.Format("{0}_{1}", superKey, key), valor, null, DateTime.Now.AddHours(1), System.Web.Caching.Cache.NoSlidingExpiration, CacheItemPriority.Default, null);
        }
        public static void Remove(string superKey, string key)
        {
            HttpRuntime.Cache.Remove(String.Format("{0}_{1}", superKey, key));
        }
        public static T Get<T>(string superKey, string key)
        {
            return (T)HttpRuntime.Cache.Get(String.Format("{0}_{1}", superKey, key));
        }


    }
}
